<!DOCTYPE html>
<?


session_start();
include('config.php');
//include('header.php');
require_once('classes/class.jira.php');
include("classes/connect.php");
require_once ('reports/calendar/src/Google_Client.php');
require_once ('reports/calendar/src/contrib/Google_CalendarService.php');
ini_set('display_errors', 'Off');


if(!isset($_SESSION["Juname"])){
	 
	echo '<meta http-equiv="refresh" content="300;url=index.php">';
}

function getuser($username,$pass,$project,$host){
		$config->username= $username;
		$config->password= $pass;
		$config->port= "";
		$config->host= $host;
		$query->project = $project;

		$queryIssue = new Jira($config);
		$array=$queryIssue->queryUser($query);
		$response = json_decode($array->responseBody);
		return $response;
		}
function getpriority($username,$pass,$host){
		$config->username= $username;
		$config->password= $pass;
		$config->port= "";
		$config->host= $host;

		$queryIssue = new Jira($config);
		$array=$queryIssue->queryAllPriority();
		$response = json_decode($array->responseBody);
		return $response;
		}

    function getDisplay($username,$pass,$host){
        $config->username= $username;
        $config->password= $pass;
        $config->port= "";
        $config->host= $host;

        $queryIssue = new Jira($config);
        $array=$queryIssue->getUser($username);
        $response = json_decode($array->responseBody);
        return $response;
        }
        
                $client = new Google_Client();
$client->setApplicationName("Google Calendar PHP Starter Application");


$client->setUseObjects(true); 
$cal = new Google_CalendarService($client);
if (isset($_GET['logout'])) {
  unset($_SESSION['token']);
}

if (isset($_GET['code'])) {
  $client->authenticate($_GET['code']);
  $_SESSION['token'] = $client->getAccessToken();
  header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
}

if (isset($_SESSION['token'])) {
  $client->setAccessToken($_SESSION['token']);
}

	
?>
        <link href="reports/examples/content/shared/styles/examples-offline.css" rel="stylesheet">
        <link href="reports/examples/content/shared/styles/kendo.common.min.css" rel="stylesheet">
        <link href="reports/examples/content/shared/styles/kendo.rtl.min.css" rel="stylesheet">
        <link href="reports/examples/content/shared/styles/kendo.default.min.css" rel="stylesheet">

        <script src="reports/js/jquery.min.js"></script>
        <script src="reports/js/kendo.web.min.js"></script>
        <script src="reports/js/console.js"></script>
        <link rel="stylesheet" href="css/header.css" type="text/css" media="all">     

<script>
            $(document).ready(function() {
                // create DatePicker from input HTML element
                $("#fromDate").kendoDatePicker({
                    format: "yyyy/M/d"
                    });
                $("#toDate").kendoDatePicker({
              format: "yyyy/M/d"
              });

            });
</script>

<?php
    if (isset($_GET['type']) && isset($_GET['cat'])) 
    { 
        $reporttype1 = $_GET['type'];
        $reporttype=  html_entity_decode($reporttype1);
        $types = explode(" - ", $reporttype);
        $cat = $_GET['cat'];

        if ($cat == 'week') 
        {
                    
        ?>                     
            <script>   

                $(document).ready(function(){
                    $('#assignee').change(function (){
                        $("#grid1").data("kendoGrid").dataSource.data([]);
                        $("#grid1").html('<div id="grid1" ></div>');
                        filterWeek();                                    
                     });

                    $('#post').change(function (){
                        $("#grid1").data("kendoGrid").dataSource.data([]);
                        $("#grid1").html('<div id="grid11" ></div>');
                        filterWeek();
                    });

                    $('#priority').change(function (){
                        $("#grid1").data("kendoGrid").dataSource.data([]);
                        $("#grid1").html('<div id="grid1" ></div>');
                        filterWeek();
                    });

                    $('#status').change(function (){
                        $("#grid1").data("kendoGrid").dataSource.data([]);
                        $("#grid1").html('<div id="grid1" ></div>');
                        filterWeek();
                    });
                                    
                    var objSelect = document.getElementById("status");
                    var tye='<?php echo $types[0];?>';
                                    
                    setSelectedValue(objSelect,tye);

                    function setSelectedValue(selectObj, valueToSet) {
                        for (var i = 0; i < selectObj.options.length; i++) {
                            if (selectObj.options[i].text=== valueToSet) {
                                selectObj.options[i].selected = true;
                                return;
                            }
                        }
                    }
                });


                            
                $(document).ready(function () {
                       filterWeek();             
                });
                
                function filterWeek()
                {
                    var a=document.getElementById("status");
                    var status=a.options[a.selectedIndex].value;
                    var b=document.getElementById("assignee");
                    var assignee=b.options[b.selectedIndex].value;
                    var c=document.getElementById("priority");
                    var priority=c.options[c.selectedIndex].value;
                    var e=document.getElementById("post");
                    var post=e.options[e.selectedIndex].value;

                    var ty='<?php echo $types[0]; ?>';
                    var fromdatestr = '<?php echo date('Y/m/d', strtotime('-2 weeks last monday')); ?>';
                    var todatestr = '<?php echo date('Y/m/d'); ?>';
                                   
                    var dataSource = new kendo.data.DataSource({
                        transport: {
                            read: {
                                 url: 'reports/ajaxdetailsFilter.php?post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type='+status+'&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                 dataType: "json"
                                }
                            },
                            schema: {
                            model: {
                                fields: {
                                    currentass: { type: "string" },
                                    modifyby: { type: "string" },
                                    ModifiedDate: { type: "date" }
                                    }
                                }
                            },
                            pageSize: <?php echo $pagesize; ?>
                        });
                                        
                        dataSource.fetch(function(){
                            var data = this.data();
                            console.log(data.length);
                        });
                        drawGrid(dataSource);      
                }
                                     
        </script>

        <?php
        }
        if ($cat == 'year') {
        ?>

            <script>     
                $(document).ready(function(){
                    $('#assignee').change(function (){
                        $("#grid1").data("kendoGrid").dataSource.data([]);
                        $("#grid1").html('<div id="grid1" ></div>');
                        filterYear();                                    
                     });

                    $('#post').change(function (){
                        $("#grid1").data("kendoGrid").dataSource.data([]);
                        $("#grid1").html('<div id="grid11" ></div>');
                        filterYear();
                   });

                    $('#priority').change(function (){
                        $("#grid1").data("kendoGrid").dataSource.data([]);
                        $("#grid1").html('<div id="grid1" ></div>');
                        filterYear();
                   });

                    $('#status').change(function (){
                        $("#grid1").data("kendoGrid").dataSource.data([]);
                        $("#grid1").html('<div id="grid1" ></div>');
                        filterYear();
                   });
                                    
                    var objSelect = document.getElementById("status");
                    var tye='<?php echo $types[0];?>';
                    setSelectedValue(objSelect,tye);

                    function setSelectedValue(selectObj, valueToSet) {
                            for (var i = 0; i < selectObj.options.length; i++) {
                                if (selectObj.options[i].text=== valueToSet) {
                                    selectObj.options[i].selected = true;
                                    return;
                                }
                            }
                        }

                    });
                            $(document).ready(function () {
                                filterYear();
                            });      
                            
                            function filterYear()
                            {
                                     var a=document.getElementById("status");
                                var status=a.options[a.selectedIndex].value;
                                var b=document.getElementById("assignee");
                                var assignee=b.options[b.selectedIndex].value;
                                var c=document.getElementById("priority");
                                var priority=c.options[c.selectedIndex].value;
                                var e=document.getElementById("post");
                                var post=e.options[e.selectedIndex].value;
                       
                                var ty='<?php echo $types[0]; ?>';
                                var fromdatestr = '<?php echo date('Y'); ?>';
                                var todatestr = '<?php echo date('d/m/Y', strtotime('next friday')); ?>';
                        
                                var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                       // url: 'ajaxdetails.php?cat=year&type='+ty+'&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                        url: 'reports/ajaxdetailsFilter.php?post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=year&type='+status+'&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                       
                                        dataType: "json"
                                            }
                                            
                                    },
                                    schema: {
                                            model: {
                                                fields: {
                                                    currentass: { type: "string" },
                                                    modifyby: { type: "string" },
                                                    ModifiedDate: { type: "date" }
                                                }
                                            }
                                        },
                                    pageSize: <?php echo $pagesize?>
                                    });
                              
                        dataSource.fetch(function(){
                           var data = this.data();
                            console.log(data.length);
                        });
                      drawGrid(dataSource);
                            }
            
                </script>

                <?php
                    }
                    if($cat=='manual')
                    {
                ?>
                        <script>
                             $(document).ready(function(){
                                    $('#assignee').change(function (){
                                       $("#grid1").data("kendoGrid").dataSource.data([]);
                                       $("#grid1").html('<div id="grid1" ></div>');
                                         filterManual();                                    
                                     });

                                     $('#post').change(function (){
                                       $("#grid1").data("kendoGrid").dataSource.data([]);
                                       $("#grid1").html('<div id="grid11" ></div>');
                                        filterManual();
                                    });

                                     $('#priority').change(function (){
                                       $("#grid1").data("kendoGrid").dataSource.data([]);
                                       $("#grid1").html('<div id="grid1" ></div>');
                                        filterManual();
                                    });

                                     $('#status').change(function (){
                                       $("#grid1").data("kendoGrid").dataSource.data([]);
                                        $("#grid1").html('<div id="grid1" ></div>');
                                         filterManual();
                                    });
                                    
                                    var objSelect = document.getElementById("status");
                                    var tye='<?php echo $types[0];?>';

                                    //Set selected
                                    setSelectedValue(objSelect,tye);

                                    function setSelectedValue(selectObj, valueToSet) {
                                        for (var i = 0; i < selectObj.options.length; i++) {
                                            if (selectObj.options[i].text=== valueToSet) {
                                                selectObj.options[i].selected = true;
                                                return;
                                            }
                                        }
                                    }

                                });
                            
                            $(document).ready(function () {
                                
                                filterManual();
                             });  
                             
                             function filterManual()
                             {
                                   var a=document.getElementById("status");
                                var status=a.options[a.selectedIndex].value;
                                var b=document.getElementById("assignee");
                                var assignee=b.options[b.selectedIndex].value;
                                var c=document.getElementById("priority");
                                var priority=c.options[c.selectedIndex].value;
                                var e=document.getElementById("post");
                                var post=e.options[e.selectedIndex].value;
                       
                                var ty='<?php echo $types[0]; ?>';
                                var fromdatestr = '<?php echo $_GET['from']; ?>';
                                var todatestr = '<?php echo $_GET['to']; ?>';
                        
                                var dataSource = new kendo.data.DataSource({
                                    transport: {
                                        read: {
                                       // url: 'ajaxdetails.php?cat=week&type='+ty+'&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                          url: 'reports/ajaxdetailsFilter.php?post='+post+'&assignee='+assignee+'&priority='+priority+'&cat=week&type='+status+'&fromdate=' + fromdatestr + '&todate=' + todatestr,
                                     
                                        dataType: "json"
                                            }
                                            
                                    },
                                    schema: {
                                            model: {
                                                fields: {
                                                    currentass: { type: "string" },
                                                    modifyby: { type: "string" },
                                                    ModifiedDate: { type: "date" }
                                                }
                                            }
                                        },
                                    pageSize: <?php echo $pagesize?>
                                    });
                            

                        dataSource.fetch(function(){
                           var data = this.data();
                            console.log(data.length);
                        });
                        drawGrid(dataSource);
                      
                             }
                </script>

    <?php
    
    }
        ?>
        
    <?php }
    else
    { ?>
        
        <script>
             $(document).ready(function(){

            	
            	    
         	    
                $('#assignee').change(function (){
                   $("#grid1").data("kendoGrid").dataSource.data([]);
                   $("#grid1").html('<div id="grid1" ></div>');
                     viewGrid();                                    
                 });

                 $('#post').change(function (){
                   $("#grid1").data("kendoGrid").dataSource.data([]);
                   $("#grid1").html('<div id="grid11" ></div>');
                    viewGrid();
                });

                 $('#priority').change(function (){
                   $("#grid1").data("kendoGrid").dataSource.data([]);
                   $("#grid1").html('<div id="grid1" ></div>');
                    viewGrid();
                });

                 $('#status').change(function (){
                     
                    var a=document.getElementById("status");
                    var status=a.options[a.selectedIndex].value;
                    
                    document.getElementById("headi").innerHTML = "Applications - "+status;
                   $("#grid1").data("kendoGrid").dataSource.data([]);
                    $("#grid1").html('<div id="grid1" ></div>');
                     viewGrid();
                });
                
                 $("#submit").click(function () {
                      var a=document.getElementById("status");
                       var status=a.options[a.selectedIndex].value;
                       var b=document.getElementById("assignee");
                       var assignee=b.options[b.selectedIndex].value;
                       var c=document.getElementById("priority");
                       var priority=c.options[c.selectedIndex].value;
                       var e=document.getElementById("post");
                       var post=e.options[e.selectedIndex].value;
                       
                      var fromdatestr=$('#fromDate').val();
                        // alert(fromdatestr);
                            var todatestr=$('#toDate').val();

                        var d1 = Date.parse(todatestr);
                        var d2 = Date.parse(fromdatestr);
                        if (d1 < d2) {
                            alert ("Invalid Date period!\n From date should be lass than To date");
                        }
                        else
                            {
                                            
                                    $("#grid1").data("kendoGrid").dataSource.data([]);
                                 $("#grid1").html('<div id="grid1" ></div>');
                    
                                 var targetURL = "ajaxmailselector2.php?urlstatus="+escape(status)+"&post="+post+"&assignee="+assignee+"&priority="+priority+"&from="+fromdatestr+"&to="+todatestr;   


                                       var dataSource = new kendo.data.DataSource({
                                       transport: {
                                           read: {
                                           url: targetURL,
                                           dataType: "json"
                                           }

                                       },
                                       schema: {
                                            model: {
                                                fields: {
                                                    currentass: { type: "string" },
                                                    modifyby: { type: "string" },
                                                    ModifiedDate: { type: "date" }
                                                }
                                            }
                                        },
                                      
                                        pageSize: <?php echo $pagesize?>
                                        
                                       });                               

                                       dataSource.fetch(function(){
                                          var data = this.data();
                                           console.log(data.length);
                                       });                                  


                                      drawGrid(dataSource);
                            }
        
                });

            });
                            

                $(document).ready(function () {
                    viewGrid();
                   });

                function viewGrid()
                {
                    // $("#grid11").data("kendoGrid").dataSource.data([]);


                       var a=document.getElementById("status");
                       var status=a.options[a.selectedIndex].value;
                       var b=document.getElementById("assignee");
                       var assignee=b.options[b.selectedIndex].value;
                       var c=document.getElementById("priority");
                       var priority=c.options[c.selectedIndex].value;
                       var e=document.getElementById("post");
                       var post=e.options[e.selectedIndex].value;
                       
                       //alert(status);

                       //$('#grid11').html('<p><img src="paginate/images/ajax-loader.gif" /></p>');
                       var targetURL = "ajaxmailselector2.php?urlstatus="+escape(status)+"&post="+post+"&assignee="+assignee+"&priority="+priority;   


                                       var dataSource = new kendo.data.DataSource({
                                       transport: {
                                           read: {
                                           url: targetURL,
                                           dataType: "json"
                                           }

                                       },
                                       schema: {
                                            model: {
                                                fields: {
                                                    currentass: { type: "string" },
                                                    modifyby: { type: "string" },
                                                    ModifiedDate: { type: "date" }
                                                }
                                            }
                                        },
                                      
                                        pageSize: <?php echo $pagesize?>,
                                        page: <?php if(isset($_SESSION['pageno'])){echo $_SESSION['pageno']; } else{ echo '1';}?>,
                                       });                               

                                       dataSource.fetch(function(){
                                          var data = this.data();
                                           console.log(data.length);
                                       });
                                      //  $('#grid11').data("kendoGrid").dataSource.read(viewGrid());


                                      drawGrid(dataSource);
                }
                
                
        </script>
  

    <?php }

?>

  <script>
 $(document).ready(function () {
    $("#checkAll").click(function () {
        $(".check-box").prop('checked', $(this).prop('checked'));
    });
    
     
});


function drawGrid(dataSource1)
{
   
                        var a=document.getElementById("status");
                       var status=a.options[a.selectedIndex].value;

                       <?php $reporttype1 = $_GET['type'];
                            $reporttype=  html_entity_decode($reporttype1);
                            $types = explode(" - ", $reporttype); ?>
                                    var typ='<?php echo $types[0];?>';

                                       if(status==='<?php echo $action_OpenCV; ?>' || status==='<?php echo $action_Rejected; ?>' || typ==='<?php echo $action_OpenCV; ?>' || typ==='<?php echo $action_Rejected; ?>' )
                                           {
                                              var a= $("#grid1").kendoGrid({ 
                                                   dataSource: dataSource1,
                                                   groupable: false,
                                                   sortable: true,
                                                   group: [{ field: "subject", dir: "desc" },{ field: "ModifiedDate", dir: "desc" },{ field: "elapsed", dir: "desc" }],
                                                   //  dataBound: onDataBound,
                                                   selectable: "row",
                                                   resizable: true,
                                                    requestStart: function () {
                                                           kendo.ui.progress($("#grid1"), true);
                                                       },
                                                       requestEnd: function () {
                                                           kendo.ui.progress($("#grid1"), false);
                                                       },
                                                   filterable:{
                                                   extra: false,
                                                   operators: {
                                                       string: {
                                                           startswith: "Starts with",
                                                       }
                                                        
                                                   }},  
                                                   
                                                    pageable: {
                                                            numeric: true,
                                                            refresh: true,
                                                            pageSizes: <?php echo $pagable; ?>,
                                                            previousNext: true,
                                                            input: true,
                                                            info: true
                                                    },
                                                   


                                                   columns:[{width:35, title:  "<input id='checkAll' type='checkbox' class='check-box' />", template: "<input type=\"checkbox\" class=\"cb1-element\" />"},
                                                           { field: "name", title: "Name",width:350},
                                                           { field: "subject", title: "Subject",width:530},
                                                           { field: "currentass",title: "Current Assignee",filterable: {ui: filterAssignee},width:200},
                                                           { field: "modifyby",title: "Modified By",filterable: {ui: filterAssignee},width:200},
                                                           { field: "ModifiedDate",title: "Modified Date", format: "{0:MM/dd/yy HH:mm}",filterable: {ui: "datetimepicker"},width:160},
                                                           { field: "elapsed",title: "Time Elapsed",width:125},
                                                           { template: "<div style=\"text-align: center;\"><img src='images/#=priority#.png'/></div>",title: "Priority",width:70},
                                                           { field: "jiraid",title: "jiraid"},
                                                           { field: "vcode",title: "vcode"},
                                                           { field: "cus",title: "cus"},
                                                           { field: "rwid",title: "id"}]
                                               });
//                                               $(".k-content").dblclick(function() { 
//                                                   alert('dblclick'); 
//                                               
//                                                });

                                               var grid7 = $('#grid1').data('kendoGrid');
                                               grid7.hideColumn(11);
                                               var grid8 = $('#grid1').data('kendoGrid');
                                               grid8.hideColumn(8);
                                               var grid9 = $('#grid1').data('kendoGrid');
                                               grid9.hideColumn(9);
                                               var grid6 = $('#grid1').data('kendoGrid');
                                               grid6.hideColumn(10);



                                             
                                   	       
                                               
                                       }
                                       else
                                       {
                                           var a=$("#grid1").kendoGrid({ 
                                                   dataSource: dataSource1,
                                                   groupable: false,
                                                   sortable: true,
                                                  // dataBound: onDataBound,
                                                   selectable: "row",
                                                   resizable: true,
                                                    requestStart: function () {
                                                           kendo.ui.progress($("#grid1"), true);
                                                       },
                                                       requestEnd: function () {
                                                           kendo.ui.progress($("#grid1"), false);
                                                       },
                                                   filterable:{
                                                   extra: false,
                                                   operators: {
                                                       string: {
                                                           startswith: "Starts with",
                                                       }
                                               
                                                   }},  
                                                   pageable: {
                                                            numeric: true,
                                                            refresh: true,
                                                            pageSizes: <?php echo $pagable; ?>,
                                                            previousNext: true,
                                                            input: true,
                                                            info: true
                                                    },

                                                   columns:[{width:35, title:  "<input id='checkAll' type='checkbox' class='check-box' />", template: "<input type=\"checkbox\" class=\"cb1-element\" />"},
                                                           { field: "name", title: "Name",width:350},                                    
                                                           { field: "post", title: "Post",width:530},                                   
                                                           { field: "currentass",title: "Current Assignee",filterable: {ui: filterAssignee},width:200},
                                                           { field: "modifyby",title: "Modified By",filterable: {ui: filterAssignee},width:200},
                                                           { field: "ModifiedDate",title: "Modified Date", format: "{0:MM/dd/yy HH:mm}",filterable: {ui: "datetimepicker"},width:160},
                                                           { field: "elapsed",title: "Time Elapsed",width:125},
                                                           { template: "<div style=\"text-align: center;\"><img src='images/#=priority#.png'/></div>",title: "Priority",width:70},
                                                           { field: "jiraid",title: "jiraid"},
                                                           { field: "vcode",title: "vcode"},
                                                           { field: "cus",title: "cus"},
                                                           { field: "rwid",title: "id"}]
                                               });

                                              var grid7 = $('#grid1').data('kendoGrid');
                                               grid7.hideColumn(11);
                                               var grid8 = $('#grid1').data('kendoGrid');
                                               grid8.hideColumn(8);
                                               var grid9 = $('#grid1').data('kendoGrid');
                                               grid9.hideColumn(9);
                                               var grid6 = $('#grid1').data('kendoGrid');
                                               grid6.hideColumn(10);
                                              

                                       }


    
}


// Delete button show and hide
$(document).ready(function (){

	
   // $("#submitDelete").hide();
    document.getElementById("submitDelete").disabled=true;
    $("#submitDelete").html('<button style=" background: none repeat scroll 0 0 rgba(0, 0, 0, 0); border: medium none;color: #919191; cursor: pointer;" id="submitDelete" class="csu" >Delete</button>');
    //$("#deletefunction").hide();
});

$(".cb1-element:checkbox").live('click', function(){
        
        if ($(this).attr("checked")) {
           // alert('test');
          // $("#submitDelete").show();
          // $("#deletefunction").show();
           document.getElementById("submitDelete").disabled=false;
    $("#submitDelete").html('<button style=" background: none repeat scroll 0 0 rgba(0, 0, 0, 0); border: medium none;color: #3C9632; cursor: pointer;" id="submitDelete" class="csu" >Delete</button>');
   
        }
        else
            {
                var i=0;
                $('input:checked').each(function () {
                    i=i+1;
                });
                if(i>0)
                 {
                    //  $("#submitDelete").show();
                    //  $("#deletefunction").show();
                     document.getElementById("submitDelete").disabled=false;
    $("#submitDelete").html('<button style=" background: none repeat scroll 0 0 rgba(0, 0, 0, 0); border: medium none;color: #3C9632; cursor: pointer;" id="submitDelete" class="csu" >Delete</button>');
   
                 }
                 else
                {
                  //  $("#submitDelete").hide();
                  //  $("#deletefunction").hide();
                   document.getElementById("submitDelete").disabled=true;
                $("#submitDelete").html('<button style=" background: none repeat scroll 0 0 rgba(0, 0, 0, 0); border: medium none;color: #919191; cursor: pointer;" id="submitDelete" class="csu" >Delete</button>');
   
                }
                
            }
 });
$(".check-box:checkbox").live('click', function(){
     if ($(this).attr("checked")) {
            //alert('test');
           document.getElementById("submitDelete").disabled=false;
    $("#submitDelete").html('<button style=" background: none repeat scroll 0 0 rgba(0, 0, 0, 0); border: medium none;color: #3C9632; cursor: pointer;" id="submitDelete" class="csu" >Delete</button>');
   
    }
    else
            {
                var i=0;
                $('input:checked').each(function () {
                    i=i+1;
                });
                if(i>0)
                 {
                       document.getElementById("submitDelete").disabled=false;
    $("#submitDelete").html('<button style=" background: none repeat scroll 0 0 rgba(0, 0, 0, 0); border: medium none;color: #3C9632; cursor: pointer;" id="submitDelete" class="csu" >Delete</button>');
   
                 }
                 else
                {
                      document.getElementById("submitDelete").disabled=true;
                $("#submitDelete").html('<button style=" background: none repeat scroll 0 0 rgba(0, 0, 0, 0); border: medium none;color: #919191; cursor: pointer;" id="submitDelete" class="csu" >Delete</button>');
   
                }
                
            }
});
$(document).ready(function () {
$('#checkAll').click(function(){
   if($('#isChkd').val() === 'true'){
        $('.cb1-element').attr('checked','checked');
        $(this).val('Uncheck All');
        $('#isChkd').val('false');
    }
    else{
        $('.cb1-element').removeAttr('checked');
        $(this).val('Check All');     
        $('#isChkd').val('true');
    }
});

});

// Check all function
$(document).on("change", ".cb1-element", function () {
    var all = $('input.cb1-element').length;
    var checked = $('input.cb1-element:checked').length;
    if(all == checked){
        $('#checkAll').attr('checked','checked');
        $('#isChkd').val('false');
        
    }else{
        $('#checkAll').removeAttr('checked');
        $('#isChkd').val('true');
       
    }
});


$(document).ready(function () {
$('#submitDelete').click(function(){

 kWindow.open();
});

});

function filterAssignee(element) {
        var assurl = "reports/ajaxfilterAssignee.php";   


        var dataSourceAss = new kendo.data.DataSource({
        transport: {
            read: {
            url: assurl,
            dataType: "json"
            }        
        }       
        });                               

        dataSourceAss.fetch(function(){
           var data = this.data();
            console.log(data);
        });
   
        element.kendoDropDownList({
            dataSource: dataSourceAss,
           optionLabel: "--Select Value--",
           width:270
        });
    }
                
  function onDataBound(e) {
                    var grid1 = $("#grid1").data("kendoGrid");
                   
                    
                    $("#grid1").delegate("tbody>tr", "dblclick", function(){
                        var row = $(this).closest("tr");
                        var rowIdx = $("tr", grid1.tbody).index(row);
                        var colIdx = $("td", row).index(this);
                        var row = grid1.select();
                        var data = grid1.dataItem(row);
                           var newwindow=window.open(url,'name','height=700,width=1340,scrollbars=yes');
                            if (window.focus) {newwindow.focus()}
                           return false;
                           
                        
                })};

                
       $(document).ready(function () {
               if( /Android|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent) ) {
            		//    document.documentElement.style.overflow = 'hide';                   
                   $(document).on('click', 'tbody tr', function(){  
            	       var values = new Array();
            	       var i=0;
            	          $(this).children().each(function(){
            	           
            	             values[i]=$(this).text();
            	           
            	             i++;
            	         })
            	       
            	         var pageno=document.getElementsByClassName('k-textbox')[0].value;
            	         var url='edit.php?name='+values[1]+'&id='+values[11]+'&jiraid='+values[8]+'&currentstatus='+values[10]+'&currentassignee='+values[6]+'&vcode='+values[9]+'&parent='+document.URL+'&curstatus='+$('#status').val()+'&pageno='+pageno+'&assignee='+$('#assignee').val()+'&post='+$('#post').val()+'&priority='+$('#priority').val()+'&fromDate='+$('#fromDate').val()+'&toDate='+$('#toDate').val();
//            	                       
            	         var newwindow=window.open(url,'name','height=700,width=1340,scrollbars=yes');
            	         if (window.focus) {newwindow.focus()}
            	        return false;
            	              
            	   });
            	
            	}
               else
               {

            	      $(document).on('dblclick', 'tbody tr', function(){  
            	       var values = new Array();
            	       var i=0;
            	          $(this).children().each(function(){
            	           
            	             values[i]=$(this).text();
            	           
            	             i++;
            	         })
            	       
            	         var pageno=document.getElementsByClassName('k-textbox')[0].value;
            	         var url='edit.php?name='+values[1]+'&id='+values[11]+'&jiraid='+values[8]+'&currentstatus='+values[10]+'&currentassignee='+values[6]+'&vcode='+values[9]+'&parent='+document.URL+'&curstatus='+$('#status').val()+'&pageno='+pageno+'&assignee='+$('#assignee').val()+'&post='+$('#post').val()+'&priority='+$('#priority').val()+'&fromDate='+$('#fromDate').val()+'&toDate='+$('#toDate').val();
//            	                       
            	         var newwindow=window.open(url,'name','height=700,width=1340,scrollbars=yes');
            	         if (window.focus) {newwindow.focus()}
            	        return false;
            	              
            	   });
                
               }

       });

  
function popitup(url) {
	 var newwindow=window.open(url,'name','height=700,width=1340,scrollbars=yes');
	 if (window.focus) {newwindow.focus()}
	return false;
}
</script>

            
     




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JIRA COMMUNI</title>
<link href="css/demo.css" rel="stylesheet" type="text/css" />
<!--<link rel="stylesheet" type="text/css" href="paginate/styles/style.css" />-->
</head>
<body class="sonata-bc" >
    <input type="hidden" id="isChkd" value="true" />   
                                                             
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container-fluid header-bar-container">
                <div class="header-bar-top">
                    <a class="brand">
                        <img src="images/logo_white.png" alt="JiraPortal">Recruitment Application      
                    </a>
                </div>
            </div>
        <?$user=getuser($username,$pass,$project,$host);?>
            <div class="container-fluid">
                <a class="btn btn-navbar" data-target=".nav-collapse" data-toggle="collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="nav-collapse">
                    <ul class="nav" id="menu" style="background-color: #1C2326">
                        <li >
                             <a class="dropdown-toggle" data-toggle="dropdown" href="reports/reportdash.php"> Reports</a> 
                        </li>
                        <li class="active">
                        	<a href="home.php">Applications</a>
                           
                        </li>
                        
                          <?if (!($client->getAccessToken())) {
                                $authUrl = $client->createAuthUrl();
                        ?>
                         <li >
                            <a class="dropdown-toggle" data-toggle="dropdown" href='<?php echo $authUrl; ?>'  >Login Google Calendar</a>         
                        </li>
                  
                        <? } else if($client->getAccessToken()){ 
                             $_SESSION['token'] = $client->getAccessToken();
                             ?>
                         <li >
                            <a class="dropdown-toggle" data-toggle="dropdown" id="undoWeek"  >Calendar</a>         
                        </li>
                        <?}?>
                        <div class="navbar-text" style="top: 18px;">                            
                             <div id="windowWeek" >
                                 <p style="font-size: 11px; color: green;">Note: If you are login first time or calendar is not properly displayed, please subscribe again and refresh your page</p>
                                 
                                 <div  class="span3" > 
                                     <div class="control-group" style="width: auto;">
                                         <label class="control-label" for="inputEmail" style="position: static; float: left;  font-size: 14px;  margin-top: 4px; top: 24px;width: 90px;">Calendars</label>
                                                                <div class="controls" style="float: left; width: 75%;">
                                                                   <?php //var_dump($user);?>
                                                                    <select name="notify[]" id="chosen"  multiple="multiple" data-placeholder="Select..." >
                                                                       <?$i=0;
                                                                       
                                                                       foreach($user as $key){
                                                                       
                                                                        ?>	
                                                                        
                                                                                <option  name="notify[]" value="src=<?php echo $key->name ?>%40eyepax.com&amp;color=%23<?php echo $calendarColor[$i];?>&amp"><?php echo $key->emailAddress ?></option>
                                                                        <?
																			$i=$i+1; }?>
                                                                        </select>
                                                                    
                                                                      </div>
                                                                <button class="k-button" id="submitCalendar" style="margin-left: 10px;">Submit</button> 
                                                              
                                                            </div>
                                     
                                                    </div>
                             <div id="heading" style="position: absolute;top: 50px"><label>Carrers</label></div>    
                              <!--  <iframe src="https://www.google.com/calendar/embed?mode=WEEK&amp;height=700&amp;wkst=2&amp;bgcolor=%23FFFFFF&amp;src=careers%40eyepax.com&amp;color=%232952A3&amp;src=achira.p%40eyepax.com&amp;color=%23125A12&amp;src=chamila.m%40eyepax.com&amp;color=%236B3304&amp;src=charith.r%40eyepax.com&amp;color=%23182C57&amp;src=%23contacts%40group.v.calendar.google.com&amp;color=%232F6309&amp;src=derick.k%40eyepax.com&amp;color=%23711616&amp;src=gawesha.b%40eyepax.com&amp;color=%23B1440E&amp;src=gayan.m%40eyepax.com&amp;color=%23875509&amp;src=lakshitha.w%40eyepax.com&amp;color=%235F6B02&amp;src=madushan.n%40eyepax.com&amp;color=%231B887A&amp;src=mahesha.h%40eyepax.com&amp;color=%23B1365F&amp;src=sanjaya.k%40eyepax.com&amp;color=%23853104&amp;src=tamara.s%40eyepax.com&amp;color=%2342104A&amp;src=tharaka.r%40eyepax.com&amp;color=%238D6F47&amp;src=tishan.m%40eyepax.com&amp;color=%23333333&amp;src=udeepa.j%40eyepax.com&amp;color=%23865A5A&amp;ctz=Asia%2FColombo" style=" border-width:0 " width="1000" height="700" frameborder="0" scrolling="no"></iframe> -->
                             <div id="iframeCalendar" style="position: relative; top: 40px;"><iframe  src="http://www.google.com/calendar/embed?showTitle=0&amp;showPrint=0&amp;mode=WEEK&amp;src=careers%40eyepax.com&color=%232952A3&amp;ctz=Asia/Colombo" style="border: 0" width="1000" height="600" frameborder="0" scrolling="no"></iframe></div>
 
                             </div>    
                                <script>
                                    $(document).ready(function() {
                                        $("#chosen").kendoMultiSelect().data("kendoMultiSelect");
                                        var windowWeek = $("#windowWeek"),
                                            undoWeek = $("#undoWeek").bind("click", function() {
                                                        windowWeek.data("kendoWindow").open();   
                                                                                                         
                                                    });
                                        var onClose = function() {
                                            undoWeek.show();
                                            
                                        }

                                        if (!windowWeek.data("kendoWindow")) {
                                            windowWeek.kendoWindow({
                                                width: "1020px",
                                                 visible  : false,
                                                title: "Google Calendar",
                                                actions: [                                

                                                    "Close"
                                                ],
                                                close: onClose
                                            });
                                            undoWeek.show();
                                        }
                    
                                    $("#windowWeek").closest(".k-window").css({
                                    top: "10%",
                                    left:"10%"
                                    });

                                    $('#submitCalendar').click(function (){

                                        var str=$('#chosen').val();
                                    	var res =str.join("amp;");

                                    	//alert($('#chosen').find('option:selected').text()); 
                                    	
                                    	var mail=$('#chosen').find('option:selected').text();
                                    	var user=mail.split('@eyepax.com');
                                    	var resUser =user.join("@eyepax.com, ");
                                    	$("#heading").html('<div id="heading"><label>Calendar for '+resUser+'</label></div>');
                                        $("#iframeCalendar").html('<div id="iframeCalendar"style="position: relative; top: 14px;"><iframe src="http://www.google.com/calendar/embed?showTitle=0&amp;showPrint=0&amp;mode=WEEK&amp;'+res+'amp;ctz=Asia/Colombo" style="border: 0" width="1000" height="600" frameborder="0" scrolling="no"</div>></iframe>');

									});
                                });

                                    
                            </script>
               
                          
                    <p style="color: #FFFFFF;font-size: 15px;font-weight: 100;"> Welcome <?php

                            $display=  getDisplay($username, $pass, $host);
                           echo $display->displayName;
                        
                        ?> [ <a href="logout.php">Logout</a> ]<p>
                </div>
            </div>
        </div>

        </div>
    </div>

<div class="homecontainer">
  
	<div class="taskdiv">	
            
		<!--<p class="logout">Welcome <?=$username?> [<a href="logout.php">Logout</a>]</p>-->
		<div class="task">  
	   
                   <?php  if (isset($_GET['type']) && isset($_GET['cat'])) 
                    { 
                        $reporttype1 = $_GET['type'];
                                $reporttype=  html_entity_decode($reporttype1);
                                $types = explode(" - ", $reporttype);
                                $cat = $_GET['cat'];

                                    if ($cat == 'week') 
                                    {?>
                                        <h2 class="configHead" style="float: left;">Week <?php echo $types[0];?> Summary - From  <?php echo  date('d-m-Y',strtotime('-1 weeks last monday'))." to ";
                                       echo  date('d-m-Y'); ?> </h2>   
                                    <?php 
                                    }
                                    else if ($cat == 'year') 
                                    {
                                    ?>
                                         <h2 class="configHead" style="float: left;">Year <?php echo $types[0];?> Summary - From   <?php echo date('d-m-Y', strtotime('first day of January ' . date('Y'))) . " to ";
                                echo date('d-m-Y'); ?> </h2>   
                                    <?php 
                                    }
                                    elseif ($cat == 'manual')  {?>
                                         <h2 class="configHead" style="float: left;"> <?php echo $types[0];?> From   <?php echo $_GET['from'] . " to "; echo $_GET['to']; ?> </h2>   
                                <?php
                                    }
                    }
                    else {
							if(isset($_SESSION['curstatus'])){?>
							<h2 id="headi" class="configHead" style="float: left;">Applications - <?php echo $_SESSION['curstatus'];?> </h2> 
								
							<?php }else{
				
							?>
                            <h2 id="headi" class="configHead" style="float: left;">Applications - OpenCV </h2>   
                   <?php }}
                                    ?>
                                    
                    
                     <script>                       
                        $(document).ready(function() {
                            $("#searc").toggle(function() {
                               // $(this).text('Hide Content');
                            }, function() {
                               // $(this).text('show Content');
                            }).click(function(){
                                $("#hidden_content").slideToggle("slow");
                            });
                        });
                    </script> 
                    <style>
                          #hidden_content{display:none;}
                    </style>
                  <div id="window">
                      <p class="delete-message">Are you sure you want to delete the data?</p>
                      <input type="button" class="yesbtn k-button" value="Yes" style="font-size: 16px;padding: 4px 20px;position: relative; left: 66px" />
                        <input type="button" class="nobtn k-button" value="No" style="font-size: 16px;padding: 4px 20px;position: relative; left: 78px" />
                    </div>
          <script>
                    var kWindow = $('#window').kendoWindow({
                    width: "320px",
                    title: "Delete Data",
                    visible: false,
                    modal:true,
                    left:"18%",
                    
                }).data('kendoWindow').center();

                $('.yesbtn').click(function () {
                     var appid=[];
                    var appjiraid=[];
                    var i=0;

                     $('input:checked').each(function () {
                        $this = $(this);
                        var one = $this.parent().siblings('td').eq(10).text();    
                        var jir = $this.parent().siblings('td').eq(7).text();

                        appid[i]=one;
                        appjiraid[i]=jir;    
                        i++;
                    });
                   
                     var pageno=document.getElementsByClassName('k-textbox')[0].value;
                    $.ajax({
                                 url: "delete.php",
                                  type: "POST",
                                    data: { 'appid[]=' : appid,'appjiraid[]' : appjiraid,'val':appid.length,'curstatus':$('#status').val(),'pageno':pageno,'assignee':$('#assignee').val(),'post':$('#post').val(),'priority':$('#priority').val(),'fromDate':$('#fromDate').val(),'toDate':$('#toDate').val() },                   
                                 success: function(data)         
                                   {   
                                       alert("Successfully Deleted");
                                       window.opener.location.reload();
                                   }
                               });

                        kWindow.close();
                });

                $('.nobtn').click(function () {
                    console.log('My other message');
                    dataitem = {};
                    kWindow.close();
                });

                    </script>
                <script>
                                  $(document).ready(function() {                   
                                      $("#priority").kendoDropDownList();     
                                      $("#status").kendoDropDownList();  
                                       $("#post").kendoDropDownList();     
                                      $("#assignee").kendoDropDownList();  
                                  });
                              </script>
                                 
                    
                    <div id="opener" style="float: right; font-size: 16px; "><a id="searc" href="#1" name="1" onclick="return show();">Search &nbsp<img class="searchbutton" src="images/search_icon.gif" > </a></div> 
                     <div style="clear: both;"></div>
                    <div id="hidden_content" style="top: 30px;">
                             
                        <div>
			<div class="statusdrop" >
                            <p class="statustext">Status &nbsp&nbsp</p>
                          
                            
                            <select id="status">
                            <?foreach($currentstatuses as $value){
                            	if(isset($_SESSION['curstatus']) && $_SESSION['curstatus']===$value)
	                            	{?>
	                            		<option selected='selected' value="<?= $value?>"><?php echo $value ?></option>
	                            	<?php }
	                            	else 
	                            	{?>
	                            		<option value="<?= $value?>"><?php echo $value ?></option>
	                            	<?php 
	                            	}

                            	}
                            	unset($_SESSION['curstatus']);
                            	unset($_SESSION['pageno']);
                            	?>	
                            </select>
			</div>
			<div class="priodrop">
			<p class="priotext">Priority &nbsp&nbsp</p>
			<?
			$priority=getpriority($username,$pass,$host);						
			?>
				<select name="priority" id="priority" onchange="getdata(1);">
					<option value="">ALL</option>
					<?
					foreach($priority as $key){
						if(isset($_SESSION['priority']) && $_SESSION['priority']===$key->name)
						{
					?>
					<option selected='selected' value='<?=$key->name?>'><?=$key->name?></option>
					<?php }
	                        else 
	                        {?>
					<option value='<?=$key->name?>'><?=$key->name?></option>
					<?}}
					
					unset($_SESSION['prority']);
                            	
                            	
                            	?>
				</select>
			</div>
			<div class="postdrop">
			<p class="posttext">Post &nbsp&nbsp</p>
			<?
			$postsql="select * from sys_jobposts where active='1'";
			$execpostquery =mysql_query($postsql);						
			?>
				<select name="post" id="post" onchange="getdata(1);"style="min-width: 200px;" >
					<option value="">ALL</option>
					<?
					while($posts = mysql_fetch_array($execpostquery)){

						if(isset($_SESSION['post']) && $_SESSION['post']===$posts['code'])
						{
					?>
					<option selected='selected' value='<?=$posts['code']?>'><?=$posts['postname']?></option>
					<?php }
	                        else 
	                        {?>
					<option value='<?=$posts['code']?>'><?=$posts['postname']?></option>
					<?}}
					
					unset($_SESSION['post']);
					?>
				</select>
			</div>
			<div class="assigneedrop">
			<p class="assigneetext">Assignee &nbsp&nbsp</p>
			
                        <select id="assignee" onchange="getdata(1);" style="min-width: 200px;" >
					<option value="">ALL</option>
					<?foreach($user as $key){
						if(isset($_SESSION['assignee']) && $_SESSION['assignee']===$key->name)
						{
						?>	
							<option selected='selected' name="assignee" value="<?php echo $key->name ?>"><?php echo $key->displayName ?></option>
							<?php }
	                        else 
	                        {?>
						<option name="assignee" value="<?php echo $key->name ?>"><?php echo $key->displayName ?></option>
					<?}}
					
					unset($_SESSION['assignee']);
					?>	
				</select>
			</div>
			
			
                            <!--<div id="upbutton"><a onclick="return hide();">click here</a></div>--> 
                            <!--<div id="opener"><a href="#1" name="1" onclick="return hide();" style="float: right; margin: -42px 0; font-size: 16px;">Search <img class="searchbutton" src="images/search_icon.gif" style="float: right;margin-top: -3px;"> </a></div>--> 
                                <div style="clear: both;"></div>
                                <div style=" float: right;position: relative;right: 488px;">
                                     <?php  if (isset($_GET['type']) && isset($_GET['cat'])) 
                                        { 
                                            $reporttype1 = $_GET['type'];
                                                    $reporttype=  html_entity_decode($reporttype1);
                                                    $types = explode(" - ", $reporttype);
                                                    $cat = $_GET['cat'];

                                                        if ($cat == 'week') 
                                                        {?>
                                                           <div class="fromdate">
                                                                <p class="assigneetext">From &nbsp&nbsp</p>   <div style="clear:both"></div>                             
                                                                <input id="fromDate" value="<?php echo date('Y/m/d', strtotime('-2 weeks last monday'));?>" style="width:150px;float: left; clear: both;" />
                                                            </div>
                                                            <div class="todate">
                                                                <p class="assigneetext">To &nbsp&nbsp</p>                               
                                                                <input id="toDate" value="<?php echo date('Y/m/d');?>" style="width:150px;float: left;" />
                                                            </div>                         
                                                            <div class="dateSubmit">                                                            
                                                                <button class="k-button" id="submit">Submit</button> 
                                                            </div>   
                                                        <?php 
                                                        }
                                                        else if ($cat == 'year') 
                                                        {
                                                        ?>
                                                             <div class="fromdate">
                                                                <p class="assigneetext">From &nbsp&nbsp</p>                                
                                                                <input id="fromDate" value="<?php echo date('Y/m/d', strtotime('first day of January ' . date('Y')))?>" style="width:150px;float: left;" />
                                                            </div>
                                                            <div class="todate">
                                                                <p class="assigneetext">To &nbsp&nbsp</p>                               
                                                                <input id="toDate" value="<?php echo date('Y/m/d');?>" style="width:150px;float: left;" />
                                                            </div>                         
                                                            <div class="dateSubmit">                                                            
                                                                <button class="k-button" id="submit">Submit</button> 
                                                            </div>   
                                                        <?php 
                                                        }
                                                        elseif ($cat == 'manual')  {?>
                                                             <div class="fromdate">
                                                                <p class="assigneetext">From &nbsp&nbsp</p>
                                                                <div style="float: left; height: auto; border: 1px solid rgb(197, 197, 197); border-radius: 5px; z-index: -1;">                            
                                                                                               
                                                                <input id="fromDate" style="width:150px;float: left;" />
                                                                </div>
                                                            </div>
                                                            <div class="todate">
                                                                <p class="assigneetext">To &nbsp&nbsp</p>     
                                                                <div style="float: left; height: auto; border: 1px solid rgb(197, 197, 197); border-radius: 5px; z-index: -1;">                            
                                                                                         
                                                                <input id="toDate" style="width:150px;float: left;" />
                                                                </div>
                                                            </div>                         
                                                            <div class="dateSubmit">                                                            
                                                                <button class="k-button" id="submit">Submit</button> 
                                                            </div>
                                                    <?php
                                                        }
                                        }
                                        else {
                                                    $sql="SELECT MIN(date(FROM_UNIXTIME(a.dateReceived))) as minDate, MAX(date(FROM_UNIXTIME(a.modifiedDate))) AS maxDate from trn_emaildetails a INNER JOIN sys_jobposts b ON b.code=a.post   WHERE a.currentStatus='OpenCV' AND a.deleted='0'  ORDER BY a.dateReceived DESC";
                                                    $query=mysql_query($sql);
                                                    while($row = mysql_fetch_array($query)){
                                            ?>
                                                        <div class="fromdate">
                                                                <p class="assigneetext">From &nbsp&nbsp</p>    
                                                                   <input id="fromDate" class='ken' value="<?php if(isset($_SESSION['fromDate'])){echo $_SESSION['fromDate']; }else{ echo date('Y/m/d',strtotime($row['minDate']));}?>"/>
                                                            	
                                                            </div>
                                                            <div class="todate">
                                                                <p class="assigneetext">To &nbsp&nbsp</p> 
                                                                                            
                                                                <input id="toDate" value="<?php if(isset($_SESSION['toDate'])){echo $_SESSION['toDate']; }else{ echo date('Y/m/d',strtotime($row['maxDate']));}?>" />
                                                           		
                                                            </div>                         
                                                            <div class="dateSubmit">                                                            
                                                                <button class="k-button" id="submit">Submit</button> 
                                                            </div>
                                       <?php 
                                                    }
                                                    
                                                    unset($_SESSION['toDate']);
                                                    unset($_SESSION['fromDate']);
                                            }
                                    ?>

                              </div>
                                 <div style="clear: both;"></div>                                
                               
                            
                        </div>
                        
                </div>
			<div class="taskcontainer">

                                
                                <div style="float: right;"><a href="home.php" >Reset Grid</a></div>
                                <div id="deletefunction" style="float: right;"><a href="#" >&nbsp;|&nbsp;&nbsp;&nbsp;</a></div>
                                <div  style="float: right;padding: 3px 6px; position: relative;top: -7px;">
                                    <button style=" background: none repeat scroll 0 0 rgba(0, 0, 0, 0); border: medium none;color: #3C9632; cursor: pointer;" id="submitDelete" class="csu" >Delete</button> </div>
				<div id="example" class="kpadding: 0 6px; position: relative;top: -7px;-content">
                                    
                                    <div id="grid1" ></div>
                                        <style scoped>
                                        #clientsDb {
                                            width: 692px;
                                            height: 413px;
                                            margin: 30px auto;
                                            padding: 51px 4px 0 4px;
                                            background: url('../../content/web/grid1/clientsDb.png') no-repeat 0 0;
                                        }
                                         #grid1:hover{
                                                cursor: pointer;
                                            }
                                         .csu:hover{
                                                cursor: pointer;
                                            }
                                    </style>
                                </div>
			</div>
                            
		</div>
	</div>
	
    
  
</div>
       
  
           
<br>
	<?
		$config->username= $username;
		$config->password= $pass;
		$config->port= "";
		$config->host= $host;

		$queryIssue = new Jira($config);
		$array=$queryIssue->Test();
		$response = json_decode($array->responseBody);
		print "<pre>".$response."</pre>";
		
		
	
	?>

<style>
     
div.k-window {
    border-style: solid;
    border-width: 10px;
    display: inline-block;
    margin: -3% 4%;
    padding-top: 2em;
    position: absolute;
    z-index: 10001;
}
    </style>
    
  
    
                
</body>
</html>